package com.ers.modelconvert;

import com.ers.model.Company;
import com.ers.validmodel.CompanyModel;

public class CompanyConvert {
	public static Company toCompany(CompanyModel companyModel){
		Company c = new Company();
		c.setAddress(companyModel.getAddress());
		c.setCreateTime(companyModel.getCreateTime());
		c.setFullName(companyModel.getFullName());
		c.setHomePage(companyModel.getHomePage());
		c.setId(companyModel.getId());
		c.setIndustry(companyModel.getIndustry());
		c.setLicense(companyModel.getLicense());
		c.setMailbox(companyModel.getMailbox());
		c.setMembers(companyModel.getMembers());
		c.setNature(companyModel.getNature());
		c.setOrganizationCode(companyModel.getOrganizationCode());
		c.setSimpleName(companyModel.getSimpleName());
		c.setDescription(companyModel.getDescription());
		return c;
	}
	
	public static CompanyModel toCompanyModel(Company company){
		CompanyModel c = new CompanyModel();
		c.setAddress(company.getAddress());
		c.setCreateTime(company.getCreateTime());
		c.setFullName(company.getFullName());
		c.setHomePage(company.getHomePage());
		c.setId(company.getId());
		c.setIndustry(company.getIndustry());
		c.setLicense(company.getLicense());
		c.setMailbox(company.getMailbox());
		c.setMembers(company.getMembers());
		c.setNature(company.getNature());
		c.setOrganizationCode(company.getOrganizationCode());
		c.setSimpleName(company.getSimpleName());
		c.setDescription(company.getDescription());
		return c;
	}
}
